<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Rake::Application - rake: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../Object.html">Object</a>
</div>

        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><a class="include" href="TaskManager.html">Rake::TaskManager</a>
  </ul>
</div>

        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li class="calls-super" ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-add_loader">#add_loader</a>
    <li ><a href="#method-i-init">#init</a>
    <li ><a href="#method-i-load_rakefile">#load_rakefile</a>
    <li ><a href="#method-i-options">#options</a>
    <li ><a href="#method-i-run">#run</a>
    <li ><a href="#method-i-run_with_threads">#run_with_threads</a>
    <li ><a href="#method-i-top_level">#top_level</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Rake::Application">
    <h1 id="class-Rake::Application" class="class">
      class Rake::Application
    </h1>

    <section class="description">
    
<p>Rake main application object.  When invoking <code>rake</code> from the command line, a <a href="Application.html"><code>Rake::Application</code></a> object is created and run.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="DEFAULT_RAKEFILES">DEFAULT_RAKEFILES
          <dd>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-name" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">name</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>The name of the application (typically ‘rake’)</p>
              </div>
            </div>
          <div id="attribute-i-original_dir" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">original_dir</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>The original directory where rake was invoked.</p>
              </div>
            </div>
          <div id="attribute-i-rakefile" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">rakefile</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Name of the actual rakefile used.</p>
              </div>
            </div>
          <div id="attribute-i-terminal_columns" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">terminal_columns</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>Number of columns on the terminal</p>
              </div>
            </div>
          <div id="attribute-i-top_level_tasks" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">top_level_tasks</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>List of the top level task names (task names from the command line).</p>
              </div>
            </div>
          <div id="attribute-i-tty_output" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">tty_output</span><span
                class="attribute-access-type">[W]</span>
            </div>

            <div class="method-description">
              <p>Override the detected TTY output state (mostly for testing)</p>
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Initialize a <a href="Application.html"><code>Rake::Application</code></a> object.</p>
                                <div class="method-calls-super">
                                  Calls superclass method
                                  
                              </div>

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/application.rb, line 49</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>
  <span class="ruby-keyword">super</span>
  <span class="ruby-ivar">@name</span> = <span class="ruby-string">&quot;rake&quot;</span>
  <span class="ruby-ivar">@rakefiles</span> = <span class="ruby-constant">DEFAULT_RAKEFILES</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-ivar">@rakefile</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@pending_imports</span> = []
  <span class="ruby-ivar">@imported</span> = []
  <span class="ruby-ivar">@loaders</span> = {}
  <span class="ruby-ivar">@default_loader</span> = <span class="ruby-constant">Rake</span><span class="ruby-operator">::</span><span class="ruby-constant">DefaultLoader</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@original_dir</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">pwd</span>
  <span class="ruby-ivar">@top_level_tasks</span> = []
  <span class="ruby-identifier">add_loader</span>(<span class="ruby-string">&quot;rb&quot;</span>, <span class="ruby-constant">DefaultLoader</span>.<span class="ruby-identifier">new</span>)
  <span class="ruby-identifier">add_loader</span>(<span class="ruby-string">&quot;rf&quot;</span>, <span class="ruby-constant">DefaultLoader</span>.<span class="ruby-identifier">new</span>)
  <span class="ruby-identifier">add_loader</span>(<span class="ruby-string">&quot;rake&quot;</span>, <span class="ruby-constant">DefaultLoader</span>.<span class="ruby-identifier">new</span>)
  <span class="ruby-ivar">@tty_output</span> = <span class="ruby-constant">STDOUT</span>.<span class="ruby-identifier">tty?</span>
  <span class="ruby-ivar">@terminal_columns</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;RAKE_COLUMNS&quot;</span>].<span class="ruby-identifier">to_i</span>

  <span class="ruby-identifier">set_default_options</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-add_loader" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_loader</span><span
                                class="method-args">(ext, loader)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Add a loader to handle imported files ending in the extension <code>ext</code>.</p>

                              <div class="method-source-code" id="add_loader-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/application.rb, line 139</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_loader</span>(<span class="ruby-identifier">ext</span>, <span class="ruby-identifier">loader</span>)
  <span class="ruby-identifier">ext</span> = <span class="ruby-node">&quot;.#{ext}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">ext</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^\./</span>
  <span class="ruby-ivar">@loaders</span>[<span class="ruby-identifier">ext</span>] = <span class="ruby-identifier">loader</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-init" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">init</span><span
                                class="method-args">(app_name=&quot;rake&quot;, argv = ARGV)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Initialize the command line parameters and app name.</p>

                              <div class="method-source-code" id="init-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/application.rb, line 88</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">init</span>(<span class="ruby-identifier">app_name</span>=<span class="ruby-string">&quot;rake&quot;</span>, <span class="ruby-identifier">argv</span> = <span class="ruby-constant">ARGV</span>)
  <span class="ruby-identifier">standard_exception_handling</span> <span class="ruby-keyword">do</span>
    <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">app_name</span>
    <span class="ruby-keyword">begin</span>
      <span class="ruby-identifier">args</span> = <span class="ruby-identifier">handle_options</span> <span class="ruby-identifier">argv</span>
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">ArgumentError</span>
      <span class="ruby-comment"># Backward compatibility for capistrano</span>
      <span class="ruby-identifier">args</span> = <span class="ruby-identifier">handle_options</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">collect_command_line_tasks</span>(<span class="ruby-identifier">args</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-load_rakefile" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">load_rakefile</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Find the rakefile and then load it and any pending imports.</p>

                              <div class="method-source-code" id="load_rakefile-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/application.rb, line 102</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_rakefile</span>
  <span class="ruby-identifier">standard_exception_handling</span> <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">raw_load_rakefile</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-options" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">options</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p><a href="Application.html"><code>Application</code></a> options from the command line</p>

                              <div class="method-source-code" id="options-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/application.rb, line 145</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">options</span>
  <span class="ruby-ivar">@options</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">OpenStruct</span>.<span class="ruby-identifier">new</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-run" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">run</span><span
                                class="method-args">(argv = ARGV)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Run the Rake application.  The run method performs the following three steps:</p>
<ul><li>
<p>Initialize the command line options (<code>init</code>).</p>
</li><li>
<p>Define the tasks (<code>load_rakefile</code>).</p>
</li><li>
<p>Run the top level tasks (<code>top_level</code>).</p>
</li></ul>

<p>If you wish to build a custom rake command, you should call <code>init</code> on your application.  Then define any tasks.  Finally, call <code>top_level</code> to run your top level tasks.</p>

                              <div class="method-source-code" id="run-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/application.rb, line 79</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">run</span>(<span class="ruby-identifier">argv</span> = <span class="ruby-constant">ARGV</span>)
  <span class="ruby-identifier">standard_exception_handling</span> <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">init</span> <span class="ruby-string">&quot;rake&quot;</span>, <span class="ruby-identifier">argv</span>
    <span class="ruby-identifier">load_rakefile</span>
    <span class="ruby-identifier">top_level</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-run_with_threads" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">run_with_threads</span><span
                                class="method-args">() { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Run the given block with the thread startup and shutdown.</p>

                              <div class="method-source-code" id="run_with_threads-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/application.rb, line 122</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">run_with_threads</span>
  <span class="ruby-identifier">thread_pool</span>.<span class="ruby-identifier">gather_history</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">job_stats</span> <span class="ruby-operator">==</span> <span class="ruby-value">:history</span>

  <span class="ruby-keyword">yield</span>

  <span class="ruby-identifier">thread_pool</span>.<span class="ruby-identifier">join</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">job_stats</span>
    <span class="ruby-identifier">stats</span> = <span class="ruby-identifier">thread_pool</span>.<span class="ruby-identifier">statistics</span>
    <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Maximum active threads: #{stats[:max_active_threads]} + main&quot;</span>
    <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Total threads in play:  #{stats[:total_threads_in_play]} + main&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-constant">ThreadHistoryDisplay</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">thread_pool</span>.<span class="ruby-identifier">history</span>).<span class="ruby-identifier">show</span> <span class="ruby-keyword">if</span>
    <span class="ruby-identifier">options</span>.<span class="ruby-identifier">job_stats</span> <span class="ruby-operator">==</span> <span class="ruby-value">:history</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-top_level" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">top_level</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Run the top level tasks of a Rake application.</p>

                              <div class="method-source-code" id="top_level-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/application.rb, line 109</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">top_level</span>
  <span class="ruby-identifier">run_with_threads</span> <span class="ruby-keyword">do</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">show_tasks</span>
      <span class="ruby-identifier">display_tasks_and_comments</span>
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">show_prereqs</span>
      <span class="ruby-identifier">display_prerequisites</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">top_level_tasks</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">task_name</span><span class="ruby-operator">|</span> <span class="ruby-identifier">invoke_task</span>(<span class="ruby-identifier">task_name</span>) }
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

